// 本地缓存

export function setCache(key, value){
    window.localStorage.setItem(key, JSON.stringify(value))
}

export function getCache(key){
    try {
        return JSON.parse(window.localStorage.getItem(key))
    } catch (e) {
        return window.localStorage?.getItem(key)
    }

}

export function clearCache(){
    window.localStorage.clear()
}